package cn.lu.joke.util;

import android.widget.EditText;

public class TextUtils {
    public static boolean isEmpty(EditText text) {
        if (text == null) {
            return true;
        }
        if (text.getText() == null) {
            return true;
        }
        if (!hasText(text)) {
            return true;
        }
        return false;
    }

    public static boolean isEmpty(String text) {
        if (text == null) {
            return true;
        }
        if (text.trim().length() < 1) {
            return true;
        }
        return false;
    }

    public static boolean hasText(EditText text) {
        if (text.getText().toString().trim().length() > 0) {
            return true;
        }
        return false;
    }
}
